<!-- TopJUI框架样式 -->
<link type="text/css" href="/topjui/themes/default/topjui.core.min.css" rel="stylesheet">
<link type="text/css" href="/topjui/themes/default/topjui.blue.css" rel="stylesheet" id="dynamicTheme"/>
<!-- FontAwesome字体图标 -->
<link type="text/css" href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<!-- layui框架样式 -->
<link type="text/css" href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
<!-- iconfont字体图标 -->
<link type="text/css" href="/static/plugins/iconfont/iconfont.css" rel="stylesheet"/>

<!-- jQuery相关引用 -->
<script type="text/javascript" src="/static/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/static/plugins/jquery/jquery.cookie.js"></script>
<!-- TopJUI框架配置 -->
<script type="text/javascript" src="/static/public/js/topjui.config.js"></script>
<!-- TopJUI框架核心-->
<script type="text/javascript" src="/topjui/js/topjui.core.min.js"></script>
<!-- TopJUI中文支持 -->
<script type="text/javascript" src="/topjui/js/locale/topjui.lang.zh_CN.js"></script>
<!-- layui框架js -->
<script type="text/javascript" src="/static/plugins/layui/layui.js" charset="utf-8"></script>

<script type="text/javascript">
	$(function () {
		var dbName = $("#dbName").val();
		var tableName = $("#tableName").val();
		var dataColumnList = JSON.parse($("#dataColumnList").val());
		var dataColumns = [];
		for(var i=0; i<dataColumnList.length; i++) {
			var dataColumn = {};
			dataColumn["field"] = dataColumnList[i];
			dataColumn["title"] = dataColumnList[i];
			dataColumn["width"] = 100;
			dataColumns.push(dataColumn);
		}
		
		$('#data-records-list').iDatagrid({
		    url:'/system/db/data/records/list?dbName='+ dbName +'&tableName=' + tableName,
		    columns:[dataColumns],
		    fitColumns:true,
			pageSize: 50
		});
	});
</script>

<table id="data-records-list"></table>
<input type="hidden" id="dbName" th:value="${dbName}"></input>
<input type="hidden" id="tableName" th:value="${tableName}"></input>
<input type="hidden" id="dataColumnList" th:value="${dataColumnList}"></input>


